package com.geniusk;

import com.geniusk.mqtt.MqttServer;
import com.geniusk.wss.WsServer;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * mqtt broker的启动
 */

@Component
public class BrokerServerStartListener implements ApplicationRunner {

    @Resource
    MqttServer mqttBroker;

    @Resource
    WsServer wsServer;

    @Override
    public void run(ApplicationArguments args) {
        mqttBroker.start();
        wsServer.start();
    }
}
